package com.stefan.controller;

import com.stefan.entity.User;
import com.stefan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/redis/user")
public class UserController {
    @Autowired
    private UserService userService;
    // This class will handle user-related requests
    // For example, it can have methods to add, delete, update, and get user information
    @PutMapping("/addUser")
    public void addUser(String name, String email) {
        userService.addUser(name, email);
        // Logic to add a user
    }
    @PutMapping("/deleteUser")
    public void deleteUser(String name) {
        // Logic to delete a user
    }

    @GetMapping("/getUser")
    public User getUser(String name) {
        // Logic to get a user's information
        return userService.getUser(name);
    }

    @PostMapping("/updateUser")
    public void updateUser(String name, String email) {
        // Logic to update a user's information
    }
}
